﻿@model IEnumerable<online_magazine1.Models.Article>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            AuthorId
        </th>
        <th>
            Theme
        </th>
        <th>
            DateCreated
        </th>
        <th>
            Title
        </th>
        <th>
            Description
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.AuthorId)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Theme.ThemeName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DateCreated)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ArticleId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ArticleId })
        </td>
    </tr>
}

</table>

<p></p>
<div>@Html.ActionLink("Logout", "LogOff", "Account")</div>